<template>
    <div>
        <el-table :data="productList" border stripe>
            <el-table-column type="index" label="序号"></el-table-column>
            <el-table-column prop="title" label="商品名称"></el-table-column>
            <el-table-column prop="img_url" width="300px" label="商品图片">
                <template slot-scope="scope">
                    <img :src="scope.row.img_url" style="width:300px">
                </template>
            </el-table-column>
            <el-table-column prop="zhaiyao" label="商品描述"></el-table-column>
            <el-table-column prop="stock_quantity" label="商品数量"></el-table-column>
            <el-table-column prop="market_price" label="市场价"></el-table-column>
            <el-table-column prop="sell_price" label="销售价"></el-table-column>
            <el-table-column prop="click" label="点击量"></el-table-column>
            <el-table-column prop="add_time" label="上架时间">
                <template slot-scope="scope">{{scope.row.add_time | dateFormat}}</template>
            </el-table-column>
        </el-table>
    </div>
</template>

<script>
export default {
  data () {
    return {
      queryInfo: {
        pageindex: 0
      },
      productList: []
    }
  },
  created () {
    this.getProductList()
  },
  methods: {
    async getProductList () {
      const { data: res } = await this.$http.get('http://www.liulongbin.top:3005/api/getgoods', { params: this.queryInfo })
      this.productList = res.message
    }
  }
}
</script>

<style lang="less" scope>

</style>
